/**
 * Created with CLion.
 * Description:
 * User: loong
 * Date: 2019-09-28
 * Time: 14:45
 */
#include "voice/voice.h"
#include <stdio.h>
#include <wiringPi.h>

int main(int argc, char *argv[]) {
    if (wiringPiSetup() < 0) {
        printf("wiringPi init error!\n");
        return -1;
    }
    //2b700ebfec6593f3e2f452b3bcb8be6e
    //参数：      网络连接标志   科大讯飞appid       图灵机器人KEY                    声卡地址
    voice_init(NETWORK_CONNECTED, "56ee43d0", "fdd81beab5994d278b86b6006bc0a1ee", "plughw:CARD=U0x46d0x825");


    /*设置输出声音格式：(详见参数列表)
     *                发音人    语速  音量  语调  不含背景音*/
    set_voice_params("xiaoyan", 50, 50, 50, 0);


    int a = open_voice_recognition_chat_control();
    if (a == -1){
        //printf("结束\n");
        return 0;
    }
    while (1) {
        sleep(60);
        //set_voice_params("donaldduck", 50, 50, 50, 0);
        //set_voice_params("xiaoyan", 50, 50, 50, 0);
        //printf("发音人改为：小燕\n");

    }
    return 0;
}